\section{Telemetry} % (fold)
\label{sec:Telemetry}

Telemetry from the high altitude vehicle is a vital requirement for the mission. The position, battery voltages, internal temperatures and so on must be constantly monitored to check that they fall within design parameters, and to allow the flight to be terminated should a problem arise. 

As the vehicle is an unmanned aerial vehicle, it is subject to strict licensing regulations by OfCom. The author holds a full amateur radio license but this expressly prohibits the use of licensed frequencies in unmanned aerial applications. OfCom provides a document detailing the exemptions under the licensing rules for which some frequency/power combinations may be used \cite{ofcom}.

\subsection{Telemetry Frequency and Power} % (fold)
\label{sub:Telemetry Frequency and Power}

From \cite{ofcom} we see that a portion of the 434MHz band is available for use on aerial vehicle, subject to a maximum of 10mW effective radiated power (ERP). This license exemption exists to allow items such as car central locking systems to be sold and operated freely. The document specifies that the license exempt module being used must be EC tested, which is an expensive and time consuming process and thus limits the options to pre-existing, commercial radio modules which are already EC approved.

10mW ERP is very little transmission power - the license exemption is designed to be enough to open a car or garage door from a distance of a few meters - and so challenges were presented in designing a system that could operate reliably over potentially several hundred km.

\subsection{Radio Module} % (fold)
\label{sub:Radio Module}

The radio module chosen is the Radiometrix NTX2\cite{ntx2}. This is a 10mW narrowband FM transmitter which transmits on 434.650MHz. The module presents a voltage controlled oscillator at the input into which a voltage of 0-3V is mapped onto an output frequency of approximately 434.650MHz $\rightarrow$ 434.670MHz. There is no ability to manipulate the phase directly, so Frequency Shift Keying (FSK) modulation was selected. CUSF has previously used a 50bps 2FSK modulation scheme with success, but 50bps is a very slow data rate which only allows basic `housekeeping' telemetry to be sent with a slow update rate.

For a more complex project such as this, it was decided to investigate methods of increasing the data rate on the telemetry downlink, using existing hardware.

\subsection{Bayesian Changepoint Detection for FSK Demodulation} % (fold)
\label{sub:Bayesian Changepoint Detection for FSK Demodulation}

Bayesian Changepoint detection is a statistical technique that has been applied to estimate the location of abrupt changes in the parameters of a data sequence. It has been applied to process industries, such as in the detection in changes of crust density in drilling operations \cite{wcp}. An investigation was undertaken to see if such techniques could be applied to demodulation of FSK signals, and improve on existing methods.

Figure \ref{fig:cp} shows an example segment of recorded telemetry audio which contains a frequency shift at position 159, from the lower `mark' frequency $\omega_1$ to the higher `space' frequency $\omega_2$. 

% subsection Bayesian Changepoint Detection for FSK Demodulation (end)

% subsection Radio Module (end)
% subsection Telemetry Frequency and Power (end)
\begin{figure}[ht]
  \centering
\includegraphics[width=0.66\textwidth]{estimation/rawpics/examplechange.png}
  \caption{An example changepoint from real telemetry}
  \label{fig:cp}
\end{figure}

We can describe this received signal $d$, with a changepoint at time $\tau$, as:

\begin{equation}
\label{cpsignal}
	d(n) = \left\{
	\begin{array}{l l}
	  A \sin\omega_1t_n + B \cos\omega_1t_n + e & \text{for } n < \tau \\
	  A \sin\omega_2t_n + B \cos\omega_2t_2 + e & \text{for } n \geq \tau \\
	\end{array} \right.
\end{equation}

We can rewrite (\ref{cpsignal}) as a general Linear Model for the signal

\begin{equation}
\textbf{d} = \textbf{Gb + e} = \begin{bmatrix} \sin\omega_1 t_1 & \cos\omega_1 t_1 \\ \sin\omega_1 t_2 & \cos \omega_1 t_2 \\ \vdots & \vdots \\ \sin \omega_2 t_{N-1} & \cos \omega_2 t_{N-1} \\ \sin \omega_2 t_N & \cos \omega_2 t_N \end{bmatrix} \begin{bmatrix} A \\ B \end{bmatrix} + \textbf{e} \\
\end{equation}

So at some position in the matrix $\textbf{G}$ the change occurs from $\omega_1$ to $\omega_2$. A specific instance of $\textbf{G}$ is called ${m}$ and we wish to calculated the probability of a given model ${m}$ given the sequence $d(n)$, the amplitude parameters $\textbf{b}$ and the additive noise $e$ which is assumed additive-white-Gaussian ($\sigma$) in this analysis. This gives the likelihood function

\begin{equation}
p \left( \textbf{d} |  \{ m \}, \sigma, \textbf{b} \right) = \left( 2 \pi \sigma^2 \right)^{-\frac{N}{2}} \exp \left [ - \frac {\textbf{e$^T$e}}{2 \sigma^2} \right ]
\end{equation}

We do not know the hyper-parameter $\textbf{b}$ or the noise $\sigma$ however they can be marginalised using the technique described in the Appendix of \cite{fitz} to produce the following marginal posterior probability:

\begin{equation}
p\left(\{m\}|\textbf{d}\right) \propto  \frac{\left[ \textbf{d$^T$d} - \textbf{d$^T$G} \left( \textbf{G$^T$G} \right)^{-1} \textbf{G$^T$d} \right]^{\frac{-(N-M)}{2}}}{\sqrt{\det \left( \textbf{G$^T$G} \right)}}
\end{equation}

An algorithm to iterate this function over all ${m}$ was written, to try and find the most probably location of the changepoint in the sample of in Figure \ref{fig:cp}. The resulting vector of probabilities is plotted in Figure \ref{fig:rawcp}.

\begin{figure}[ht]
	\centering
	\includegraphics[width=0.66\textwidth]{estimation/rawpics/raw.png}
	\caption{Unnormalized marginal posterior probability of changepoint location of sample telemetry signal}
	\label{fig:rawcp}
\end{figure}

It can be seen that the algorithm produces an estimate with a very small variance - it can easily find the changepoint in this representative telemetry signal.

Noise was then added to the signal to assess the robustness of the changepoint detector. Figure \ref{fig:cpresults} shows the results.

\begin{figure}[!ht]
	\centering
	\subfloat[SNR = 0dB]{{\label{fig:0db}}\includegraphics[width=0.45\textwidth]{estimation/rawpics/0db.png}}
	\subfloat[SNR = -3dB]{{\label{fig:-3db}}\includegraphics[width=0.45\textwidth]{estimation/rawpics/neg3db.png}}\\
	\subfloat[SNR = -6dB]{{\label{fig:-6db}}\includegraphics[width=0.45\textwidth]{estimation/rawpics/neg6db.png}}
	\caption{Marginal Posterior probabilities of changepoint location for signals of progressively decreasing Signal to Noise Ratio. Probability distributions are unnormalised.}
	\label{fig:cpresults}
\end{figure}

At 0dB SNR, the commercial soundcard demodulation software that CUSF has previously been using failed to decode most of the bits, however Figure \ref{fig:0db} shows the changepoint detector can still easily estimate the location of the changepoint at this SNR. If noise is added such that the SNR becomes -3dB, {\emph i.e.} the noise power is twice the signal power, then we can see in Figure \ref{fig:-3db} that the detector can still make a reasonably accurate estimate of the changepoint location - the off the shelf software completely failed to decode under these noise conditions. If the SNR is decreased to -6dB (Figure \ref{fig:-6db}, the detector begins to struggle to accurately determine changepoint location. However, a good Gaussian fitting algorithm could extract an acceptable estimate of the changepoint from this sample.

This demodulation scheme appears to work significantly better than the matched filter implemented in the demodulation software previously used. Matched filter techniques can often suffer from issues in alignment of the time slicing discriminator, especially in high noise conditions. This new technique shows a clear improvement in performance, at the expense of computation complexity. However, the algorithm as designed works in faster than real-time in Matlab. If written in a compiled language, such as C, orders of magnitude speed increases could expect to be seen, and might even allow other parameters to be marginalised rather than needing to be known a priori, such as $\omega_1$ and $\omega_2$.

This algorithm makes the assumption that the channel noise is Gaussian. Real channels are often not Gaussian and further work will be undertaken to improve the estimator further with more realistic noise modelling.

Whilst a precise analysis of the exact improvement over matched filter techniques has not been made due to time constraints, the author estimates it to be of the order of 4 - 6dB SNR for a given bit error rate. In combination with well understood and simple to implement Forward Error Correction schemes such as Reed-Solomon encoding, Turbo-codes or Low Density Parity Check codes, it is estimated that the telemetry downlink capacity could be increased to perhaps 1.2kbps, which would be sufficient to send much higher rate telemetry data, such as inertial sensor data, and perhaps even small pictures.

% section Telemetry (end)
